package com.jumi.microservice.stock.mapper;

import com.jumi.microservice.stock.dto.commodity.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ssk
 * @create 2020/9/1 10:06
 **/
public interface CommodityApplyMapper {

    int save(CommodityApplyDTO applyRequest);

    int saveDetails(@Param("details") List<CommodityApplyDetailDTO> list);

    int saveMaterials(@Param("materials") List<CommodityApplyMaterialDTO> list);

    CommodityApplyDTO findById(Long id);

    int render(List<CommodityRenderDTO> list);

    List<CommodityApplyMaterialDTO> findMaterials(@Param("applyId") Long applyId,@Param("skuId") Long skuId);


    List<CommodityApplyDTO> findAll(CommodityApplyDTO applyDTO);

    int update(CommodityApplyDTO applyDTO);

    int updatePre(CommodityApplyDTO applyDTO);

    List<CommodityRenderDTO> findRenders(@Param("applyId") Long applyId,@Param("warehouseId") Long warehouseId);

    List<CommodityRenderResultDTO> findRendersByType(@Param("applyId") Long applyId, @Param("type") Integer type);

}
